We need a hook to be able to close down the device properly, but the REMOVE
event is no good because we don't get the script and vif environment variables
set in that case.
Closes bug #417.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
break;
case XenbusStateClosed:
- device_unregister(&be->dev->dev);
+ kobject_hotplug(&dev->dev.kobj, KOBJ_OFFLINE);
+ device_unregister(&dev->dev);
break;
case XenbusStateUnknown:
case XenbusStateInitWait:
default:
- xenbus_dev_fatal(be->dev, -EINVAL, "saw state %d at frontend",
+ xenbus_dev_fatal(dev, -EINVAL, "saw state %d at frontend",
frontend_state);
break;
}